package com.example.blogsystem.mapper;

import com.example.blogsystem.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    /*
    * 根据名称，查询用户信息
    * */
    @Select("select id,user_name,password from `user` where user_name = #{userName} and delete_flag = 0;")
    public UserInfo getUser(String userName);
    /*
    *根据id查询用户信息
    * */
    @Select("select user_name,github_url from `user` where id = #{id} and delete_flag = 0;")
    public UserInfo getAuthorById(Integer id);
    @Select("select id,user_name,github_url from `user` where id = #{id} and delete_flag = 0;")
    public UserInfo getUserInfoByid(Integer id);
}
